import { ref } from 'vue'
import axios from 'axios'

async function useBusInfo<T>(line: number) {
    const result = ref<T>()

    await axios.get((import.meta.env.PROD ? '/api' : 'http://127.0.0.1:4000') + '/businfo/' + line)
        .then((res) => {
            result.value = res.data
        })
        .catch(err => console.log(err))
    // console.log(result)
    return result.value
}

export default useBusInfo